package com.example.testrecorder.utils;

import android.util.Log;

/**
 * @author Yingyong Lao
 * 创建时间 2021/5/22 20:12
 * @version 1.0
 */
public class LogUtil {
    private static final int VERBOSE=1;
    private static final int DEBUG=2;
    private static final int INFO=3;
    private static final int WARN=4;
    private static final int ERROR=5;
    private static final int CONTROL=6;//控制日志的打印级别,如果改为小于1的数，将不打印任何日志
    public static void logV(String TAG,String msg){
        if(CONTROL>VERBOSE){
            Log.v(TAG,msg);
        }
    }
    public static void logD(String TAG,String msg){
        if(CONTROL>DEBUG){
            Log.d(TAG,msg);
        }
    }
    public static void logI(String TAG,String msg){
        if(CONTROL>INFO){
            Log.i(TAG,msg);
        }
    }
    public static void logW(String TAG,String msg){
        if(CONTROL>WARN){
            Log.w(TAG,msg);
        }
    }
    public static void logE(String TAG,String msg){
        if(CONTROL>ERROR){
            Log.e(TAG,msg);
        }
    }
}
